Hello I am new to DXL script, i am using c# language to access Doors and pass all of the requirements ids from doors to c#.
however i am facing an issue whenever i run my scrip file from c# i get "-R-E- DXL: <C:\Desktop\oleSetResult.dxl:7> null Module do loop parameter was passed this is my c# code:
//IDoorsDXL d = Activator.CreateInstance(typeof(DOORSCOMLib.DOORSClass)) as IDoorsDXL;
if (Process.GetProcessesByName("doors").Length == 0)
{
System.Diagnostics.Process proc = new System.Diagnostics.Process();
proc.StartInfo.FileName = "C:\\Program Files (x86)\\IBM\\Rational\\DOORS\\9.3\\bin\\doors.exe";
proc.StartInfo.Arguments = "-u noura.alshamsi -P adasi@123";
proc.StartInfo.UseShellExecute = false;
proc.Start();
// Wait for GUI to fire up ...
proc.WaitForInputIdle();
}
DOORSCOMLib.DOORSClass d = new DOORSCOMLib.DOORSClass();
d.runFile("C:\\Users\\noura.alshamsi\\Desktop\\oleSetResult.dxl");// is there is any way to run the module before running my DXL scrip ?
// TODO: Implement Functionality
Console.Write("Result = " + d.result);
Console.ReadKey(true);
}
my DXL script code:
Module nCurMod = current
Object oCurObj
string sReqID
int iReqCount = 0
string fullIDs =""
for oCurObj in nCurMod do {
sReqID = probeAttr_(oCurObj, "_Tag")
string sub = "SRS"
int offset = null
int length = null
bool matchCase = true
bool reverse = true
if (findPlainText (sReqID, sub, offset, length, matchCase, reverse)){
iReqCount ++;
fullIDs = fullIDs sReqID" "
print sReqID "\n"
}
}
oleSetResult(fullIDs)
print "Requirements..." iReqCount "\n"
print "Requirements..." fullIDs "\n"
the script works fine if i opened the module myself however whenever i am using c# since the module isnt opened yet it throws as exception any idea how can i open a specific module either with c# or DXL ? it looks like c# opens DXL module for doors main window. MiniCircuit - Mon Aug 14 08:21:52 EDT 2017 |
Re: how to open DXL interaction window for a specific module Simple. You need to open the module from your code:
Module m = read('/MyProject/MyModule', true /* visible */)
If you need to pass the module name dynamically from your code, you should use something like this from Java: String sCode = "current = read(\"/MyProject/MyModule\", true);\n#include <c:/path/to/myscript.dxl>" d.runStr(sCode); // make sure current is set before executing the file. Hope this helps, regards, Mathias |
Re: how to open DXL interaction window for a specific module Mathias Mamsch - Mon Aug 14 11:01:14 EDT 2017 Simple. You need to open the module from your code:
Module m = read('/MyProject/MyModule', true /* visible */)
If you need to pass the module name dynamically from your code, you should use something like this from Java: String sCode = "current = read(\"/MyProject/MyModule\", true);\n#include <c:/path/to/myscript.dxl>" d.runStr(sCode); // make sure current is set before executing the file. Hope this helps, regards, Mathias Mathias thank you so much thats exactly what i needed :D |